import React from 'react';

import Dialog from './../Dialog';

import Content from './content';

interface Res {
    min:number,
    max:number
}

export default (
    min: number = 18,
    max: number = 100
):Promise<Res> => (
    new Promise(resolve => {
        const content = (
            <Content
                min={min}
                max={max}
                onConfirm={resolve}
            />
        )
        Dialog.show(content, {
            direction: `bottom`,
            clickClose: true
        })
    })
)